package com.wpp.controller;

import com.wpp.pojo.Employee;
import com.wpp.pojo.User;
import com.wpp.service.EmployeeService;
import com.wpp.service.UserService;
import com.github.pagehelper.*;
import com.wpp.service.impl.EmployeeServiceImpl;
import com.wpp.service.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;
    @Autowired
    private EmployeeService employeeService;
    int id = 1;

    @RequestMapping("/test")
    public String test() {
        System.out.println("succes输出了");
        List<User> all = userService.findAll(id);
        System.out.println(all + "------controller------");
        return "succes";
    }

    @RequestMapping("/test2")
    public String test2() {
        PageHelper.startPage(2, 3);
        List<Employee> all = employeeService.GetFindAll();
        System.out.println(all + "========================");
        return "succes";
    }
}
